Skip to content

Conversation

@emetsger
Copy link
Contributor

@emetsger emetsger commented Sep 9, 2015

This is a PR for the initial BagIt modules, a base module and one module for support classes. Initially the support module has a BagUri class and another class for representing the roles played by various files in the BagIt specification.

…a value. BoundToken doesn't quite pass the smell test because it really only serves a purpose for LITERAL tokens. The other tokens already have a value in their 'tokenString' field.
 1. Added a parseString(...) method to Token, which will return a List<BoundToken> containing all the Tokens in the supplied String.
 2. Changed the behavior of parse(...) to return BoundToken instead of Token.
 3. Changed behavior of parse(...) to return a BoundToken for every literal character encountered.  Before it would return a single LITERAL token even if multiple literal characters were encountered.  The behavior of parseString(...) also returns a LITERAL BoundToken for each literal character.

The behaviors of parse(...) and parseString(...) differ, however, and this may be fixed in the future:
- parse("**") returns a single BoundToken(DIR, "**")
- parseString("**") returns a List<BoundToken> containing two BoundToken(ZERO_OR_MORE_CHARACTERS, "*")
…nd Javadoc. Expression represents a path, or a pattern to match a path. The ExpressionMatcher is responsible for matching a path Expression against a pattern Expression. There is still some work to do here with regard to path separators, and tokenizing Expression strings that end with "/".

There is one unit test to resolve, and some more Javadoc to do, class/method level as well as package level.
…n: mistakenly used BoundToken.toString() instead of intentionally composing a string representation of the the BoundToken.
…match(CharSequence, CharSequence, int, int, int, int) from having to handle '**' tokens. Includes test and Javadoc updates.
htpvu pushed a commit that referenced this pull request Nov 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant